using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Typing_GUI
{
    public partial class frmLevels : Form
    {
        
        public frmLevels()
        {
            InitializeComponent();
        }

        public int userID;
        public int type = 1;

        private void frmLevels_Load(object sender, EventArgs e)
        {

        }
        
        private void btnEasy_Click(object sender, EventArgs e)
        {
            if (type == 1)
            {
                frmText frm = new frmText();
                frm.UserID = this.userID;
                frm.levelLesson = 1;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
            else
            {
                frmAdventure frm = new frmAdventure();
                frm.userId = this.userID;
                frm.levels = 1;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
        }
        private void MakeVisibleAgain(object sender, FormClosedEventArgs e)
        {
            this.Close();
        }

        private void btnMedium_Click(object sender, EventArgs e)
        {
            if (type == 1)
            {
                frmText frm = new frmText();
                frm.UserID = this.userID;
                frm.levelLesson = 2;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
            else
            {
                frmAdventure frm = new frmAdventure();
                frm.userId = this.userID;
                frm.levels = 2;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
        }

        private void btnHard_Click(object sender, EventArgs e)
        {
            if (type == 1)
            {
                frmText frm = new frmText();
                frm.UserID = this.userID;
                frm.levelLesson = 3;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
            else
            {
                frmAdventure frm = new frmAdventure();
                frm.userId = this.userID;
                frm.levels = 3;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
        }

        private void btnVeryHard_Click(object sender, EventArgs e)
        {
            if (type == 1)
            {
                frmText frm = new frmText();
                frm.UserID = this.userID;
                frm.levelLesson = 4;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
            else
            {
                frmAdventure frm = new frmAdventure();
                frm.userId = this.userID;
                frm.levels = 4;
                frm.FormClosed += new FormClosedEventHandler(MakeVisibleAgain);
                frm.Show();
                this.Visible = false;
            }
        }

    }
}